package com.yanftch.jsonformat.test;

import com.intellij.openapi.ui.DialogBuilder;
import com.intellij.notification.NotificationGroupManager;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages;
import com.yanftch.jsonformat.json2ets.views.SetGetChooseDialog;

public class TestAction extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
//        NotificationGroupManager.getInstance().getNotificationGroup("id_jsonformat_toast").createNotification("JsonFormat通知", "测试通知~", NotificationType.INFORMATION).notify(e.getProject());
        SetGetChooseDialog dialog = new SetGetChooseDialog();
        dialog.setOnButtonClickListener(new SetGetChooseDialog.OnButtonClickListener() {
            @Override
            public void isConfirm(boolean isConfirm) {
                if (isConfirm) {
                    NotificationGroupManager.getInstance().getNotificationGroup("id_jsonformat_toast")
                            .createNotification("JsonFormat通知", "测试通知~confirm", NotificationType.INFORMATION).notify(e.getProject());
                } else {
                    NotificationGroupManager.getInstance().getNotificationGroup("id_jsonformat_toast")
                            .createNotification("JsonFormat通知", "测试通知~cancel", NotificationType.INFORMATION).notify(e.getProject());
                }
            }
        });
        dialog.setVisible(true);
    }
}
